package org.study.mybatis.api.model;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;

import java.io.Serializable;
import java.time.LocalDate;
import java.util.Date;

/**
 * Student 实体类：基本数据类型在 Java 类中都有默认值，会导致 MyBatis 在执行相关操作时很难判断当前字段是否为 null，
 * 所以在 MyBatis 环境下使用 Java 实体类时尽量不要使用基本数据类型，都使用对应的包装类型
 *
 * @author Administrator
 * @date 2021-05-24
 */
@Data
@Builder
@ToString
@AllArgsConstructor
@NoArgsConstructor
public class Student implements Serializable {
    private static final long serialVersionUID = -5317586699500289459L;

    private Long id;

    private String name;

    private LocalDate birthday;

    private Integer sex;

    private Integer state;

    private String address;

    private Integer classId;

    private Date createTime;
}
